﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Media;
namespace _MetalSlug
{
    using GifAnimation;
using _MetalSlug.Mementoes;
    using _MetalSlug.MyUtilities;
    
    public static class GameUtil
    {
        public static Vector2 ScreenSize;
        static ContentManager Content;
        static AudioManager audio;
        public static int CurrentDifficultyLevel;
        public static MyPivot GamePivot;

        public static AudioManager Audio
        {
            get 
            { 
                if(audio == null)
                {
                    audio = new AudioManager();
                }
                return GameUtil.audio; 
            }
        }

        public static void SetContent(ContentManager content)
        {
            Content = content;
        }

        public static Video LoadVideo(String FileName)
        {
            return Content.Load<Video>(FileName);
        }

        public static SpriteFont LoadFont(String FileName)
        {
            return Content.Load<SpriteFont>(FileName);
        }

        public static List<Texture2D> LoadTextures(String Format, int Count)
        {
            List<Texture2D> Textures = new List<Texture2D>();
            for (int i = 0; i < Count; i++)
            {
                Texture2D temp = GameUtil.Content.Load<Texture2D>(Format + i.ToString("00"));
                Textures.Add(temp);
            }
            return Textures;
        }

        public static Texture2D LoadTexture(String FileName)
        {  
            Texture2D Texture = GameUtil.Content.Load<Texture2D>(FileName); 
            return Texture;
        }

        public static GifAnimation LoadGif(String FileName)
        {
            GifAnimation GifImage = GameUtil.Content.Load<GifAnimation>(FileName);
            return GifImage;
        }

        public static SoundEffect LoadSoundEffect(String FileName)
        {
            SoundEffect Sound = GameUtil.Content.Load<SoundEffect>(FileName);
            return Sound;
        }

        public static Song LoadSong(String FileName)
        {
            Song song = GameUtil.Content.Load<Song>(FileName);
            return song;
        }
    }
}
